VNC Viewer ActiveX Control is a independent control that realizes all the vnc viewer's function. It need not any other libraries. The Details include:
Open the
"VNCViewerXControl.ocx" with Regsvr32.exe,then you can use the control
in all develop tools.
There are several properties of the
control:
Published:
Public:
property AutoScroll as Boolean;
Description
If AutoScroll is true, the scroll bars appear automatically when necessary. For example, if the user resizes the control so that some of its controls are partially obscured, scroll bars appear.
If AutoScroll is false, scroll bars don't appear automatically. In this case, use the HorzScrollBar and VertScrollBar properties to make scroll bars appear.
If the property Stretch is set, it will take no effect.
Property Codec as TVNCCodec;
TVNCCodec=(vncHextile, vncCoRRE, vncRRE, vncCopyRect, vncRAW)
Property EnableBell as boolean;
Description
if EnableBell is true, the viewer will bell when the server bell.
Property FrameUpdateDelay as Word;
Description
FrameUpdateDelay determines how frequently the viewer will request frames updating from the server in milliseconds
Property Password as String;
description
The login password of the viewer.
Property Port as Integer;
Description
The login Port of the viewer.
Property Server as String;
Description
The Address the viewer will connect to.
Property RequestFrames as Boolean;
Description
If the RequestFrames is true, the viewer will reuqest updating from the server every "RequestFramesDelay" milliseconds. Or the viewer will never update.
Property PixelFormat as TPixelFormat;
TPixelFormat=(VNCAuto,VNC8Bit)
Property ShareDesktop as Boolean;
Description
If ShareDesktop is ture, the server will not disconnect other clients when the viewer logined.
Property Stretch as Boolean;
Description
If Stretch is true, the remote screen will stretch to the width and height the user set. And the property AutoScroll will take no effect.
Property TransferKeys as boolean;
Description
if TransferKeys is true, The viewer will transfer the key actions to the server.
Property TransferMouse as boolean;
Description
if TransferMouse is true, The viewer will transfer the mouseactions to the server.
Property TransferLocalClipboard as boolean;
Description
if TransferLocalClipboard is true, The viewer will transfer the local clipboard actions to the server.
Property TransferServerClipboard as boolean;
Description
if TransferServerClipboard is true, server will transfer the server clipboard actions to the viewer.
Property xPosition as Integer;
Description
xPosition is x position of the left-top point of the remote screen Which will display in the viewer control's rectangle.
Property yPosition as Integer;
Description
yPosition is yposition of the left-top point of the remote screen Which will display in the viewer control's rectangle
The VNC Viewer Control have three method:
Sub Connect;
Description
Connect to the server using the property "Server", "Port", "Password" are set.
Sub Disconnect;
Description
Disconnect the viewer from server.
Sub RequestUpdate;
Descriptio
Force the viewer to update a frame.
The VNC Viewer control have seven special events:
Sub OnAuthFail()
Description
When the viewer login to server fail, the event will occur.
Sub OnConnectClose()
Description
When the viewer disconnect from server, the event will occur.
Sub OnConnected()
Description
When the Viewer connected to the server, the event occurs
Sub OnConnectError( ErrorMsg as String);
Description
When error happened during the viewer is connecting to the server, the event occurs. The ErrorMsg is the error message.
Sub OnFrameSize( FrameWidth,FrameHeight as Integer);
Description
When viewer login to server successfully, the server will return the width and height of the remote screen, then the event occurs. FrameWidth and FrameHeight are the width and height of remote screen.
Sub OnHostname( HostName as String);
Description
When viewer login to server successfully, the server will return the name of the remote host. HostName is the name of the remote host.
Sub OnStatus( ErrorMsg as String);
Description
The event occurs during the login process. The ErrorMsg is the message return.